package com.bosicen.crm.dao.sysmanage;
/**
 * 企业信息数据操作类
 */
import java.util.List;


import org.springframework.stereotype.Component;
import com.bosicen.crm.dao.HibernateDao;
import com.bosicen.crm.dao.entity.OrderNode;
import com.bosicen.crm.tools.Page;

@Component("orderNodeDao")
@SuppressWarnings("unchecked")
public class OrderNodeDao extends HibernateDao<OrderNode, Integer> {

	/****
	 * 查询列表
	 * @param id
	 * @return
	 */
	
	public List<OrderNode> findOrderNodeList(int companyid){
		return this.getSession().createQuery(" from OrderNode where companyid=?  order by id asc").setParameter(0, companyid).list();
	}
	
	/****
	 * 查询列表
	 * @param id
	 * @return
	 */
	
	public Page findOrderNodeByPage(int companyid,Page page){
		return this.findPage(page, " from OrderNode o where o.companyid=? order by o.id desc", companyid);
	}
	
	/**
	 * 按ID查询
	 * @param id
	 * @return
	 */
	public OrderNode findOrderNodeById(int id){
		return this.get(id);
	}
	
	/***
	 * 删除
	 * @param c
	 */
	public void delOrderNode(OrderNode c){
		this.delete(c.getId());
	}
	
	/**
	 * 保存
	 */
	public void saveOrUpdate(OrderNode OrderNode){
		this.getSession().saveOrUpdate(OrderNode);
	}
	
}
